/*****************************************************************************/
/*!	\file sysctype.h
 *	\brief definition file
	\par        Dalian Yunxing Tech Co., Ltd.

				Dalian, China
				Phone   : +86 (411) 8825 4852
				Email   : yx@yunxing.tech
 */
 /*****************************************************************************/
#ifndef SYSCTYPE_H
#define SYSCTYPE_H 1

#ifndef S_OK
#define S_OK		0
#endif

/* Define TRUE and FALSE if not defined */
#ifndef FALSE
/*! \brief FALSE if not defined */
#define FALSE	0
#endif
#ifndef TRUE
/*! \brief TRUE if not defined */
#define TRUE	1
#endif

#ifndef yx_max
#define yx_max(a,b)            (((a) > (b)) ? (a) : (b))
#endif

#ifndef yx_min
#define yx_min(a,b)            (((a) < (b)) ? (a) : (b))
#endif


/*!\brief BYTES_NONE 0 bytes size*/
#define BYTES_NONE 		0
/*!\brief BYTES_64 64 bytes size*/
#define BYTES_64 		64
/*!\brief BYTES_128 128 bytes size*/
#define BYTES_128 		128
/*!\brief BYTES_256 256 bytes size*/
#define BYTES_256 		256
/*!\brief KILOBYTE 1024 bytes size*/
#define KILOBYTE 		1024
/*!\brief KILOBYTES_2 2048 bytes size*/
#define KILOBYTES_2 		2048
/*!\brief KILOBYTES_4 4096 bytes size*/
#define KILOBYTES_4 		4096
/*!\brief KILOBYTES_8 8192 bytes size*/
#define KILOBYTES_8 		8192

typedef struct StringList {
	unsigned int  length;
	char** list;
} StringList;


#if defined (__PARADIGM__) || defined(_SC1x5_)
typedef int 					tThreadIdentifer;
#elif defined(WIN32) || defined(WIN64)
typedef void* tThreadIdentifer;
// typedef HANDLE				tThreadIdentifer;
#elif defined(__linux__)
typedef unsigned long int		tThreadIdentifer;
// typedef pthread_t				tThreadIdentifer;
#elif defined(VXWORX_ACE)
typedef	int						tThreadIdentifer;
#endif

#if !defined(TGTTYPES_H) && !defined(OS_TYPES_H)

#ifdef BORLAND_BOOLEAN
/*!	\brief Size : 8 bits	Range : TRUE or FALSE */
#define Boolean				bool
#else
/*!	\brief Size : 8 bits	Range : TRUE or FALSE */
typedef unsigned char 		Boolean;
#endif // BORLAND_BOOLEAN

#if  defined(WIN32) && (! defined(_NI_mswin32_) )
/*!	\brief Size : 8 bits	Range : 0 to 255 */
typedef unsigned char 			U8;
/*!	\brief Size : 8 bits	Range : -128 to 127 */
typedef signed char 			S8;
/*!	\brief Size : 8 bits	Range : 0 to 255 */
typedef unsigned char 			BYTE;
/*!	\brief Size : 16 bits	Range : 0 to 65,535  */
typedef unsigned  short  int	U16;
/*!	\brief Size : 16 bits	Range : -32,768 to 32,767 */
typedef signed short int 		S16;
/*!	\brief Size : 32 bits	Range : 0 to 4,294,967,295 */
typedef unsigned int			U32;
/*!	\brief Size : 32 bits	Range : -2,147,483,648 to 2,147,483,647 */
typedef signed int 				S32;
/*!	\brief Size : 64 bits	Range : 0 to 18,446,744,073,709,551,615 */
typedef unsigned long long 		U64;
/*!	\brief Size : 64 bits	Range : -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */
typedef signed long long		S64;

#elif  defined(_NI_mswin32_)
/*!	\brief Size : 8 bits	Range : 0 to 255 */
typedef unsigned char 			U8;
/*!	\brief Size : 8 bits	Range : -128 to 127 */
typedef signed char 			S8;
/*!	\brief Size : 8 bits	Range : 0 to 255 */
typedef unsigned char 			BYTE;
/*!	\brief Size : 16 bits	Range : 0 to 65,535  */
typedef unsigned  short  int	U16;
/*!	\brief Size : 16 bits	Range : -32,768 to 32,767 */
typedef signed short int 		S16;
/*!	\brief Size : 32 bits	Range : 0 to 4,294,967,295 */
typedef unsigned int			U32;
/*!	\brief Size : 32 bits	Range : -2,147,483,648 to 2,147,483,647 */
typedef signed int 				S32;
/*!	\brief Size : 64 bits	Range : 0 to 18,446,744,073,709,551,615 */
typedef unsigned __int64 		U64;
/*!	\brief Size : 64 bits	Range : -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */
typedef signed __int64			S64;
#elif defined(__linux__) || defined(__CHRONOS__) || defined(_SC1x5_)
#include	<stdint.h>
/*!	\brief Size : 8 bits	Range : 0 to 255 */
typedef uint8_t                 U8;
/*!	\brief Size : 8 bits	Range : -128 to 127 */
typedef int8_t                  S8;
/*!	\brief Size : 8 bits	Range : 0 to 255 */
typedef unsigned char 			BYTE;
/*!	\brief Size : 16 bits	Range : 0 to 65,535  */
typedef uint16_t                U16;
/*!	\brief Size : 16 bits	Range : -32,768 to 32,767 */
typedef int16_t                 S16;
/*!	\brief Size : 32 bits	Range : 0 to 4,294,967,295 */
typedef uint32_t				U32;
/*!	\brief Size : 32 bits	Range : -2,147,483,648 to 2,147,483,647 */
typedef int32_t 				S32;
/*!	\brief Size : 64 bits	Range : 0 to 18,446,744,073,709,551,615 */
typedef uint64_t				U64;
/*!	\brief Size : 64 bits	Range : -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */
typedef int64_t 				S64;
#elif defined(VXWORX_ACE)
/*!	\brief Size : 8 bits	Range : 0 to 255 */
typedef unsigned char	 		U8;
/*!	\brief Size : 8 bits	Range : -128 to 127 */
typedef signed char				S8;
/*!	\brief Size : 8 bits	Range : 0 to 255 */
typedef unsigned char 			BYTE;
/*!	\brief Size : 16 bits	Range : 0 to 65,535  */
typedef unsigned short			U16;
/*!	\brief Size : 16 bits	Range : -32,768 to 32,767 */
typedef signed short			S16;
/*!	\brief Size : 32 bits	Range : 0 to 4,294,967,295 */
typedef unsigned int			U32;
/*!	\brief Size : 32 bits	Range : -2,147,483,648 to 2,147,483,647 */
typedef signed int 				S32;
/*!	\brief Size : 64 bits	Range : 0 to 18,446,744,073,709,551,615 */
typedef unsigned long long		U64;
/*!	\brief Size : 64 bits	Range : -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */
typedef signed long long		S64;
#elif defined(WIN64)
/*!	\brief Size : 8 bits	Range : 0 to 255 */
typedef unsigned char 			U8;
/*!	\brief Size : 8 bits	Range : -128 to 127 */
typedef signed char 			S8;
/*!	\brief Size : 8 bits	Range : 0 to 255 */
typedef unsigned char 			BYTE;
/*!	\brief Size : 16 bits	Range : 0 to 65,535  */
typedef unsigned  short  int	U16;
/*!	\brief Size : 16 bits	Range : -32,768 to 32,767 */
typedef signed short int 		S16;
/*!	\brief Size : 32 bits	Range : 0 to 4,294,967,295 */
typedef unsigned int			U32;
/*!	\brief Size : 32 bits	Range : -2,147,483,648 to 2,147,483,647 */
typedef signed int 				S32;
/*!	\brief Size : 64 bits	Range : 0 to 18,446,744,073,709,551,615 */
typedef unsigned __int64 		U64;
/*!	\brief Size : 64 bits	Range : -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */
typedef signed __int64			S64;
#else
/*!	\brief Size : 8 bits	Range : 0 to 255 */
typedef unsigned char 			U8;
/*!	\brief Size : 8 bits	Range : -128 to 127 */
typedef signed char 			S8;
/*!	\brief Size : 8 bits	Range : 0 to 255 */
typedef unsigned char 			BYTE;
/*!	\brief Size : 16 bits	Range : 0 to 65,535  */
typedef unsigned   int			U16;
/*!	\brief Size : 16 bits	Range : -32,768 to 32,767 */
typedef signed  int 			S16;
/*!	\brief Size : 32 bits	Range : 0 to 4,294,967,295 */
typedef unsigned long int		U32;
/*!	\brief Size : 32 bits	Range : -2,147,483,648 to 2,147,483,647 */
typedef signed long int 		S32;
#endif
#if defined(__PARADIGM__)
typedef U32 U64;
typedef S32 S64;
#endif
/*!	\brief Size : 32 bits	Range : Exponent 8 bits, Fraction 32 bits of precision */
typedef float				Float32;
/*!	\brief Size : 64 bits	Range : Exponent 11 bits, Fraction 52 bits of precision */
typedef double				Float64;
/*!	\brief Size : 80 bits	Range : Exponent 15 bits, Fraction 63 bits of precision */
typedef long double			Float80;

#endif // !defined(TGTTYPES_H) && !defined(OS_TYPES_H)
#endif // SYSCTYPE_H
